import Taro from "@tarojs/taro";
import { View,Text,Input,Picker,Textarea } from "@tarojs/components";
import { useState } from "react";
import './index.scss'


export default function EduBack(props){

const {Info,changeEduItem}=props

const handleChange=(key,value)=>{
  changeEduItem(({//修改子类展示数据
    ...Info,
    [key]:value
    }))
}


  return(
    <View className='eduBack'>

      {/* 教育背景*/}
      <View className='at-row'>
          <View className='at-col at-col-3'>
              教育背景:
          </View>
          <Input 
            className='at-col at-col-9 contextborder' 
            name='school'
            type='text'
            value={Info.school}
            onBlur={(e)=>{handleChange('school',e.detail.value)}}
          />
      </View>

     

      <View className='at-row'>
        <View className='at-col at-col-4'>在读时间: 开始</View>

        <Picker mode='date' className='at-col at-col-6'  onChange={(e)=>{handleChange('startTime',e.detail.value)}}>
                <View className='picker'>
                  {Info.startTime}
                </View>
              </Picker>
        </View>


      <View className='at-row'>
      <View className='at-col at-col-4' style={{textIndent:'4em'}}>
       &nbsp;
      结束</View>

        <Picker mode='date' className='at-col at-col-6'  onChange={(e)=>{handleChange('endTime',e.detail.value)}}>
                <View className='picker'>
                  {Info.endTime}
                </View>
              </Picker>
        </View>

        <View className='at-row'>
          <View className='at-col at-col-3'>
              专业:
          </View>
          <Input 
            className='at-col at-col-9 contextborder' 
            name='major'
            type='text'
            value={Info.major}
            onBlur={(e)=>{handleChange('major',e.detail.value)}}
          />
      </View>
    </View>
  )
}